
<UserControl x:Class="LitwareHR.PublicApp.WinUX.CandidatesView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:local="clr-namespace:LitwareHR.PublicApp.WinUX"
    xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Background="{DynamicResource PageBackgroundBrush}">
  <UserControl.Resources>
    <Storyboard x:Key="OnLoadedTransition">
      <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="rootCanvas" Storyboard.TargetProperty="(UIElement.Opacity)">
        <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
        <SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
      </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Style x:Key="headerStyle1" TargetType="{x:Type GridViewColumnHeader}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
            <Border  BorderThickness="2,2,0,2" CornerRadius="5,0,0,5" TextBlock.TextAlignment="Center" Width="{TemplateBinding  Width}" BorderBrush="#FF1D0F48" Background="#FFE2EFC3"  >
              <ContentPresenter Content="{TemplateBinding Content}" Height="15" ></ContentPresenter>
            </Border>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="headerStyle3" TargetType="{x:Type GridViewColumnHeader}">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
            <Border  BorderThickness="0,2,2,2" CornerRadius="0,5,5,0" TextBlock.TextAlignment="Center" Width="{TemplateBinding  Width}" BorderBrush="#FF1D0F48" Background="#FFE2EFC3"  >
              <ContentPresenter Content="{TemplateBinding Content}" Height="15" ></ContentPresenter>
            </Border>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="ListViewItemStyleBase" TargetType="{x:Type ListViewItem}">
      <Setter Property="BorderThickness" Value="1,1,1,1" />
      <Setter Property="BorderBrush" Value="#FF1D0F48" />
      <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
      <Setter Property="VerticalContentAlignment" Value="Stretch"/>
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="{x:Type ListViewItem}">
            <Border BorderBrush="{DynamicResource GridBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="5,5,5,5" Margin="0,0,0,0" Width="300">
              <StackPanel>
                <GridViewRowPresenter Height="15" Width="300"/>
              </StackPanel>
            </Border>
            <ControlTemplate.Triggers>
              <Trigger Property="IsSelected" Value="True">
                <Setter Property="Background" Value="Yellow"></Setter>
              </Trigger>
            </ControlTemplate.Triggers>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    <Style x:Key="LstVwItmStyle1" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource ListViewItemStyleBase}">
      <Setter Property="Background" Value="#FFEBEBEB" />
    </Style>
    <Style x:Key="LstVwItmStyle2" TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource ListViewItemStyleBase}">
      <Setter Property="Background" Value="#FFC9D5E1" />
    </Style>
    <local:ListViewItemStyleSelector x:Key="ListViewItemStyleSelector" />
  </UserControl.Resources>
  <UserControl.Triggers>
    <EventTrigger RoutedEvent="FrameworkElement.Loaded">
      <BeginStoryboard Storyboard="{StaticResource OnLoadedTransition}"/>
    </EventTrigger>
  </UserControl.Triggers>
  <Canvas x:Name ="rootCanvas" Width ="850" Height ="Auto" Background="{DynamicResource PageBackgroundBrush}">
    <Canvas Width ="850" Height ="519" Background="{DynamicResource PageBackgroundBrush}">
    </Canvas>
    <Border x:Name ="TopPanelBorder" BorderBrush="{DynamicResource BorderBrush}" Width="780" Canvas.Top="20" Canvas.Left="20" BorderThickness="1" CornerRadius="0,10,0,0" Margin="0,5,5,0" Background="{DynamicResource BottomPanelBrush}">
      <DockPanel>
        <TextBlock Margin="5,2,5,2" Background="#00FFFFFF" FontSize="13" Foreground="#FFFFFFFF" Text="Candidates" DockPanel.Dock="Left" VerticalAlignment="Center"></TextBlock>
      </DockPanel>
    </Border>
    <Border x:Name="MiddleBorder" Canvas.Top="54" Canvas.Left="20" Width="780" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" CornerRadius="0,0,10,0" Margin="0,2,5,2" Background="{DynamicResource ContentAreaBrush}" Height="424">
      <DockPanel>
        <ListView Background ="{DynamicResource GridBrush}" ItemsSource ="{Binding}" ItemContainerStyleSelector="{StaticResource ListViewItemStyleSelector}" DockPanel.Dock="Left" x:Name="CandidatesListView" SelectionChanged="OnCandidatesListView_SelectionChanged" Width="312">
          <ListView.View>
            <GridView AllowsColumnReorder="False" ColumnHeaderToolTip="Candidates">
              <GridViewColumn Header="Applicant" Width="102" HeaderContainerStyle="{StaticResource headerStyle1}">
                <GridViewColumn.CellTemplate>
                  <DataTemplate>
                    <Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,2,0" Margin="0,0,0,0">
                      <TextBlock Margin="1,0,0,0" Text="{Binding Path=Applicant}" Width="100"/>
                    </Border>
                  </DataTemplate>
                </GridViewColumn.CellTemplate>
              </GridViewColumn>
              <GridViewColumn Header="Position" Width="205" HeaderContainerStyle="{StaticResource headerStyle3}">
                <GridViewColumn.CellTemplate>
                  <DataTemplate>
                    <Border BorderBrush="{DynamicResource GridBrush}" BorderThickness="0,0,0,0" Margin="0,0,0,0">
                      <TextBlock Margin="1,0,0,0" Text="{Binding Path=Position}" Width="200"/>
                    </Border>
                  </DataTemplate>
                </GridViewColumn.CellTemplate>
              </GridViewColumn>
            </GridView>
          </ListView.View>
        </ListView>
        <Border x:Name="ResumeBorder" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" CornerRadius="0,0,10,0" Margin="5,2,5,2" Background="{DynamicResource ContentAreaBrush}">
          <Grid DockPanel.Dock="Right">
            <StackPanel x:Name="ResumeStackPanel" Visibility="Hidden">
              <TextBlock Text="Resume" Background="#00FFFFFF" FontSize="18" Foreground="#FFFFFFFF" HorizontalAlignment="Center"></TextBlock>
              <TextBlock Text="Name" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="16"></TextBlock>
              <TextBlock Text=" "></TextBlock>
              <TextBlock Text="{Binding Path=ApplicantName}" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="12"></TextBlock>
              <TextBlock Text=" "></TextBlock>
              <TextBlock Text="Last Name" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="16"></TextBlock>
              <TextBlock Text=" "></TextBlock>
              <TextBlock Text="{Binding Path=ApplicantLastName}" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="12"></TextBlock>
              <TextBlock Text=" "></TextBlock>
              <TextBlock Text="Address" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="16"></TextBlock>
              <TextBlock Text=" "></TextBlock>
              <TextBlock Text="{Binding Path=Address}" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="12"></TextBlock>
              <TextBlock Text=" "></TextBlock>
              <TextBlock Text="Phone Number" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="16"></TextBlock>
              <TextBlock Text=" "></TextBlock>
              <TextBlock Text="{Binding Path=PhoneNumber}" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="12"></TextBlock>
              <TextBlock Text=" "></TextBlock>
              <TextBlock Text="Additional Information" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="16"></TextBlock>
              <TextBlock Text=" "></TextBlock>
              <TextBlock Text="{Binding Path=AdditionalInfo}" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="12"></TextBlock>
              <TextBlock Text=" "></TextBlock>                
              <TextBlock x:Name="VideoResumeTextBlock" Text="Video" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="16"></TextBlock>
              <TextBlock Text=" "></TextBlock>
              <TextBlock x:Name="VideoUploadStateTextBlock" Text="No Video Available" Visibility="Hidden" Margin="25,0,0,0" Foreground="#FFFFFFFF" FontSize="12"></TextBlock>
              <StackPanel x:Name="WebBrowserStackPanel" Width="280">              
              <WindowsFormsHost>
                  <wf:WebBrowser x:Name="webBrowser"/>
                </WindowsFormsHost>
              </StackPanel>
              </StackPanel>
            <StackPanel x:Name="OfflineStackPanel" Visibility="Hidden">
              <TextBlock Foreground="#FFFFFFFF" Margin="5,5,5,5" FontSize="14" Text="You cannot see the resume when you are offline."></TextBlock>
            </StackPanel>
            </Grid>
        </Border>
      </DockPanel>
    </Border>
    <StackPanel Canvas.Top ="479" Width ="785" Margin="20,0,20,0">
      <Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness ="1"  CornerRadius ="0,0,10,0" Margin="0,5,5,2" Background="{DynamicResource BottomPanelBrush}">
        <DockPanel Name="dpBottomPanel" FlowDirection="LeftToRight" Height="25">
          <Image x:Name="imgSchemaChanged" Source="../../Images/Alert.png" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="15,5,5,5" Height="16" Width="23" Visibility="Hidden"></Image>
          <TextBlock x:Name="tbSchemaChanged" Text="Schema Changed" DockPanel.Dock="Left" VerticalAlignment="Center" Margin="5" Foreground="{DynamicResource HeaderTextBrush}" Visibility="Hidden"/>
          <TextBlock x:Name="tbSync" Text="Synchronizing" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,5,15,5" Foreground="{DynamicResource HeaderTextBrush}" Visibility="Hidden"/>
          <Image x:Name="imgSync" Source="../../Images/sync.png" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="5" Height="16" Width="23" HorizontalAlignment="Right" Visibility="Hidden">
            <Image.LayoutTransform>
              <RotateTransform CenterX="0.5" CenterY="0.5" />
            </Image.LayoutTransform>
          </Image>
        </DockPanel>
      </Border>
      <Border BorderBrush="{DynamicResource BorderBrush}" Name="BottomPanelShadow" CornerRadius ="0,10,0,0" Margin="0,0,5,5" Height="25" Background="{DynamicResource GridShadowBrush}"/>
    </StackPanel>
  </Canvas>
</UserControl>

